import axios from 'axios'

const instance = axios.create({
  baseURL:"/mei",
  "Content-Type":"application/json"
})

// 全局请求拦截,axios发起的请求都会先经过这里
instance.interceptors.request.use((config)=>{
 if(sessionStorage.getItem("token")){
   config.headers["token"] = sessionStorage.getItem("token")
 }
  return config
})

// 响应拦截器
instance.interceptors.response.use((res)=>{
  return res
})

export default instance;
